package com.suxin.algorithm.db;

import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue;
import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm;
import lombok.extern.slf4j.Slf4j;


import java.util.Collection;

/**
 * @author Tang
 * @classname GoodsDbPreciseShardingAlgorithm
 * @description [  ]
 * @date 2021/3/9 10:40
 */
@Slf4j
public class GoodsDbPreciseShardingAlgorithm implements PreciseShardingAlgorithm<Integer> {

    @Override
    public String doSharding(Collection<String> availableTargetNames, PreciseShardingValue<Integer> shardingValue) {
        log.info("分库算法参数:可用的库名称集合:{},分库键的值:{}",availableTargetNames, shardingValue.getValue());
        return "db0";
    }
}